The present invention, in some embodiments thereof, relates to cache consistency systems and methods for managing them and, more particularly, but not exclusively, to hybrid distributed cache consistency systems and methods for managing them.
Distributed cache consistency is an important practical problem which arises in many domains and systems such as distributed file systems, web caches, content distribution networks, Domain Name System (DNS) services, Memory-Grids and NoSQL data stores to name a few. In such systems, a client machine often caches data retrieved from a server machine, in order to potentially avoid retrieving this data again in the near future. If during the time the client is caching the data, this data is modified at the server (e.g. an update is sent from a different client) then the cached data is stale (i.e. inconsistent). In many use-cases it is important to avoid stale data. Thus, given a distributed cache, the cache consistency mechanism is typically used to ensure client caches are made aware of updates that have occurred to their client side cache unit contents in a timely manner. Distributed cache consistency mechanisms can be broadly classified as client-based or server-based.
Client-based solutions rely on time-to-live (TTL) mechanisms or periodic polling. In both of these approaches the client's cache can become stale if an update occurs between two polls or shortly after an object is retrieved from the server. In many applications data freshness is of critical importance making client-based approaches unsuitable.
In server-based solutions the servers inform clients of updates as they occur thus improving the data-freshness of client caches. The servers send clients a notification message when an update occurs and the clients then either update their cache with the newer object version or at least remove the stale object from the cache so that the newer version is retrieved on the next access. Server-based solutions typically must track object caching by clients, in order to send update notifications to the appropriate clients.
An additional cache consistency approach is hierarchical caching, also referred to as cooperative caching. Hierarchical caching is the sharing and coordination of cache state among multiple communicating caches. A cache hierarchy consists of levels of caches, having parent-child relationships, which communicate with each other. Cache servers in hierarchical caching networks cooperate with one another. A proxy can forward requests, for example, to a parent cache level. Such cooperation is intended to achieve improved caching in terms of network load, stale time etc.